home *** CD-ROM | disk | FTP | other *** search
- Path: chaos.kulnet.kuleuven.ac.be!usenet
- From: Andreas De Troy <andreas=de=troy%psl%pedcc3.kuleuven.ac.be>
- Newsgroups: comp.lang.c
- Subject: c
- Date: 24 Jan 1996 16:41:34 GMT
- Organization: KUL
- Message-ID: <4e5nfu$f4t@chaos.kulnet.kuleuven.ac.be>
- NNTP-Posting-Host: pcip194.psy.kuleuven.ac.be
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.2N (Windows; I; 16bit)
-
- news:1996Jan24.144108.23883@river.tay.ac.uk
- insc2mb@river.tay.ac.uk (Mr persil) wrote:
- >I wonder if anyone can help. I have written a program to add an word to the
- >end of a text file. This text file was created using msdos editor. The c
- >compiler is borland. I try using the a and a+ modes to append to the end
- >of the file. I used fprintf(text,word); but this doesn't seem to add the
- >word to the file.
- >
- >If anyone could help it would be greatly appreacite
- >
- Maybe your original file has an end-of-file marker (Ctrl Z, ASCII code 26 I
- believe) as the last character. In that case fprintf (..) adds its
- string beyond this EOF-marker and you will not see it in your editor, because
- many editors stop reading their input as soon as they encounter
- the EOF-marker. A binary dump of your textfile should reveal this (and look
- at the filesize reported by "dir": it will be changed).
-
- A file produced by (Borland) fprintf-statements does not have this
- EOF-marker; but everytime you (edit the file and) save the file with your
- editor, you will have this problem.
-
-
-